package com.daocao.jy.fragment;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.daocao.jy.R;
import com.daocao.jy.adapter.AgencyRecordAdapter;
import com.daocao.jy.adapter.MyCouponAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 18-4-10.
 */

public class AgencyRecordFragment extends BaseFragment {
    @BindView(R.id.list)
    RecyclerView list;
    Unbinder unbinder;
    private AgencyRecordAdapter adapter;
    private int id;

    @Override
    protected int setLayoutId() {
        return R.layout.fragment_my_agency_record;
    }

    @Override
    protected void initView() {
        if (getArguments() != null) {
            id = getArguments().getInt("id", 0);
        }
        adapter = new AgencyRecordAdapter(getContext());
        list.setAdapter(adapter);

        List<String> data = new ArrayList<>();
        data.add("dadsa");
        data.add("dadsa");
        data.add("dadsa");
        adapter.update(data);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
